{include file="common/head"/}
<div class="admin-main layui-anim layui-anim-upbit">
    <fieldset class="layui-elem-field layui-field-title">
        <legend>清空数据库</legend>
    </fieldset>
    <div class="demoTable">
        <div class="layui-form">
        <div class="layui-inline">
            <input class="layui-input" name="password" id="password" type="password" placeholder="请输入登陆密码">
        </div>
        <button class="layui-btn" id="search"  data-type="reload" lay-filter="sub" lay-submit>确认</button>
    </div>
    </div>
</div>
</body>
<script src="/static/plugins/layui/layui.js"></script>
<script>
    layui.use(['form', 'layer'], function () {
        var form = layui.form,$ = layui.jquery;
        // 登录提交监听
        form.on('submit(sub)', function (data) {
            var loading = layer.load(1, {shade: [0.1, '#fff']});
            $.post("{:url('delete')}",data.field,function(res){
                layer.close(loading);
                if(res.code > 0){
                    layer.msg(res.msg,{time:1000,icon:1},function(){
//                        location.href = "{:url('index/index')}";
                    });
                }else{
                    layer.msg(res.msg,{time:1000,icon:2});
                    // $('.captcha img').attr('src','{:url("verify")}?id='+Math.random());
                }
            });
        })
    })
</script>
</html>